package com.detech.sbmh.base.hibernate.log.entity;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "tb_log_sys")
public class TbLogSys {
    private String id;
    private String logType;
    private String module;
    private String operator;
    private String content;
    private String ip;
    private Date logTime;
    private String methodUrl;
    private String methodParams;
    private String stackTrace;

    @Id
    @Column(name = "id")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "log_type")
    public String getLogType() {
        return logType;
    }

    public void setLogType(String logType) {
        this.logType = logType;
    }

    @Basic
    @Column(name = "module")
    public String getModule() {
        return module;
    }

    public void setModule(String module) {
        this.module = module;
    }

    @Basic
    @Column(name = "operator")
    public String getOperator() {
        return operator;
    }

    public void setOperator(String operator) {
        this.operator = operator;
    }

    @Basic
    @Column(name = "content")
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "ip")
    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    @Basic
    @Column(name = "log_time")
    public Date getLogTime() {
        return logTime;
    }

    public void setLogTime(Date logTime) {
        this.logTime = logTime;
    }

    @Basic
    @Column(name = "method_url")
    public String getMethodUrl() {
        return methodUrl;
    }

    public void setMethodUrl(String methodUrl) {
        this.methodUrl = methodUrl;
    }

    @Basic
    @Column(name = "method_params")
    public String getMethodParams() {
        return methodParams;
    }

    public void setMethodParams(String methodParams) {
        this.methodParams = methodParams;
    }

    @Basic
    @Column(name = "stack_trace")
    public String getStackTrace() {
        return stackTrace;
    }

    public void setStackTrace(String stackTrace) {
        this.stackTrace = stackTrace;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TbLogSys tbLogSys = (TbLogSys) o;
        return Objects.equals(id, tbLogSys.id) &&
                Objects.equals(logType, tbLogSys.logType) &&
                Objects.equals(module, tbLogSys.module) &&
                Objects.equals(operator, tbLogSys.operator) &&
                Objects.equals(content, tbLogSys.content) &&
                Objects.equals(ip, tbLogSys.ip) &&
                Objects.equals(logTime, tbLogSys.logTime) &&
                Objects.equals(methodUrl, tbLogSys.methodUrl) &&
                Objects.equals(methodParams, tbLogSys.methodParams) &&
                Objects.equals(stackTrace, tbLogSys.stackTrace);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, logType, module, operator, content, ip, logTime, methodUrl, methodParams, stackTrace);
    }
}
